//
//  MNDSlideUpViewController.m
//  minidai
//
//  Created by 容贤郁 on 2017/5/30.
//  Copyright © 2017年 迷你金服. All rights reserved.
//

#import "MNDSlideUpViewController.h"

@interface MNDSlideUpViewController () <UIScrollViewDelegate>

@property (weak, nonatomic) IBOutlet UIScrollView *scrollView;
@property (weak, nonatomic) IBOutlet UIImageView *imageView;

@end

@implementation MNDSlideUpViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.scrollView.delegate = self;
    
    if (kScreenWidth <= 320) {
        [self.imageView setImage:[UIImage imageNamed:@"home_slide_up_640"]];
    }
    if (kScreenHeight >= 812) {
        [self.imageView setImage:[UIImage imageNamed:@"home_slide_up_1125"]];
    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    
}

#pragma mark - UIScrollView Delegate

- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate {
    
}

- (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset {
    if (scrollView.contentOffset.y <= 0) {

        [self dismissViewControllerAnimated:YES completion:^{
        
        }];
    }
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
